Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: leave call from system message 'call_ended_everyone' #13977

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

Antreesy
Copy link
Contributor

☑️ Resolves

  • Fix hanging interface when call with a lot of participants ended for everyone
  • Client wait for signaling update (usersInCallChanged) to leave by itself
  • Additionaly, system message in chat is a good equivalent of the fact call has ended

How to test:

  1. apply patch to imitate delay in receiving a signal
diff --git a/src/utils/webrtc/webrtc.js b/src/utils/webrtc/webrtc.js
--- a/src/utils/webrtc/webrtc.js	(revision c4a63ff18ae6aa83acb0f54e14c7d91832fabee5)
+++ b/src/utils/webrtc/webrtc.js	(date 1733849256161)
@@ -473,10 +473,12 @@
 		&& localUserInCall) {
 		console.info('Force leaving the call for current participant')
 
+		setTimeout(() => {
 		store.dispatch('leaveCall', {
 			token: store.getters.getToken(),
 			participantIdentifier: store.getters.getParticipantIdentifier(),
 		})
+		}, 3000)
 
 		// Do not return to disconnect already from the other participants
 		// without waiting for another signaling event about changed users.
  1. Join call as user1 + user2
  2. As user1, end call for everyone

🖌️ UI Checklist

🖼️ Screenshots / Screencasts

🏁 Checklist

  • 🌏 Tested with different browsers / clients:
    • Chromium (Chrome / Edge / Opera / Brave)
    • Firefox
    • Safari
    • Talk Desktop
    • Not risky to browser differences / client
  • ⛑️ Tests are included or not possible

Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a quick test, this only seems to work/make a difference with HPB and not for the moderator.

  • User left side
  • Moderator right side
Bildschirmaufzeichnung.vom.2024-12-11.07-34-08.webm

but I tested with 2 sleeps in the leave call controller method

Make join slow

diff --git a/lib/Controller/CallController.php b/lib/Controller/CallController.php
index 8128e4314..c292b655c 100644
--- a/lib/Controller/CallController.php
+++ b/lib/Controller/CallController.php
@@ -221,6 +221,8 @@ class CallController extends AEnvironmentAwareOCSController {
        #[RequireParticipant]
        #[RequireReadWriteConversation]
        public function joinCall(?int $flags = null, bool $silent = false, bool $recordingConsent = false): DataResponse {
+               // SIMULATE OVERLOADED SERVER
+               sleep(5);
                try {
                        $this->validateRecordingConsent($recordingConsent);
                } catch (\InvalidArgumentException) {
@@ -248,6 +250,8 @@ class CallController extends AEnvironmentAwareOCSController {
                                $this->participantService->changeInCall($this->room, $this->participant, $flags, false, $silent);
                        }
 
+                       // SIMULATE HUGE CALL
+                       sleep(15);
                        return $response;
                }
 
@@ -257,6 +261,9 @@ class CallController extends AEnvironmentAwareOCSController {
                } catch (\InvalidArgumentException $e) {
                        return new DataResponse(['error' => $e->getMessage()], Http::STATUS_BAD_REQUEST);
                }
+
+               // SIMULATE HUGE CALL
+               sleep(15);
                return new DataResponse(null);
        }
 

Make leave slow

diff --git a/lib/Controller/CallController.php b/lib/Controller/CallController.php
index 8128e4314..0be725cd4 100644
--- a/lib/Controller/CallController.php
+++ b/lib/Controller/CallController.php
@@ -493,6 +493,9 @@ class CallController extends AEnvironmentAwareOCSController {
        #[PublicPage]
        #[RequireParticipant]
        public function leaveCall(bool $all = false): DataResponse {
+               // SIMULATE OVERLOADED SERVER
+               sleep(5);
+
                $session = $this->participant->getSession();
                if (!$session instanceof Session) {
                        return new DataResponse(null, Http::STATUS_NOT_FOUND);
@@ -507,6 +510,9 @@ class CallController extends AEnvironmentAwareOCSController {
                                $this->participantService->changeInCall($this->room, $this->participant, Participant::FLAG_DISCONNECTED);
                        }
 
+                       // SIMULATE HUGE CALL
+                       sleep(15);
+
                        return $response;
                }
 
@@ -526,6 +532,9 @@ class CallController extends AEnvironmentAwareOCSController {
                        }
                }
 
+               // SIMULATE HUGE CALL
+               sleep(15);
+
                return new DataResponse(null);
        }
 

src/store/messagesStore.js Outdated Show resolved Hide resolved
@nickvergessen nickvergessen force-pushed the fix/noid/swift-leave-call branch from c4a63ff to 3ad04b3 Compare January 9, 2025 08:05
@nickvergessen nickvergessen merged commit 4b399bc into main Jan 9, 2025
50 checks passed
@nickvergessen nickvergessen deleted the fix/noid/swift-leave-call branch January 9, 2025 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants